extracting digits from a number